<script>
export default {
  components: {},
  name: "",
  data() {
    return {
      formData: {
        biographical_notes_id: "",
        connect_remark: "",
        connect_label: "",
        last_connect_time: "",
      },
      rules: {},
      tagsArr: [],
    };
  },
  props: {
    maskItem: {
      type: Object,
      default: () => {},
    },
  },
  setup() {},
  methods: {
    pickerOptions(time) {
      return time <= new Date();
      // console.log(time.getTime());
    },
    cancel() {
      this.$emit("cancel");
    },
    confirm() {
      let data = { ...this.formData };
      data.last_connect_time = this.$converData.getDate(data.last_connect_time);
      this.$emit("ok", data);
    },
  },
  mounted() {},
  async created() {
    this.formData.biographical_notes_id = this.maskItem.biographical_notes_id;
    this.tagsArr = await this.$getCate.getCateFn(9);
  },
};
</script>
<template>
  <div>
    <el-form
      label-width="120px"
      :rules="rules"
      :model="formData"
      ref="maskForm"
    >
      <el-form-item label="沟通标签">
        <el-select
          v-model="formData.connect_label"
          filterable
          placeholder="请选择沟通标签"
        >
          <el-option
            v-for="item in tagsArr"
            :key="item.name"
            :label="item.name"
            :value="item.name"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="下次沟通时间">
        <el-date-picker
          v-model="formData.last_connect_time"
          type="date"
          style="width: 100%"
          placeholder="请选择下次沟通时间"
          :disabled-date="pickerOptions"
        />
      </el-form-item>
      <el-form-item label="沟通备注">
        <el-input
          v-model="formData.connect_remark"
          maxlength="1000"
          placeholder="请输入沟通备注"
          show-word-limit
          :rows="4"
          type="textarea"
        />
      </el-form-item>
    </el-form>
    <el-row class="row-bg" justify="end">
      <el-button @click="cancel">取消</el-button>
      <el-button type="primary" @click="confirm"> 确认 </el-button>
    </el-row>
  </div>
</template>
<style scoped lang="less"></style>
